package com.iotp.service.disease_area;

import com.iotp.dao.disease_area.DiseaseAreaMapper;
import com.iotp.entity.disease_area.DiseaseArea;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service("diseaseAreaService")
public class DiseaseAreaServiceImpl implements DiseaseAreaService {
    @Autowired
    private DiseaseAreaMapper diseaseAreaMapper;
    @Override
    public Long add(DiseaseArea diseaseArea) {
        this.diseaseAreaMapper.insert(diseaseArea);
        return diseaseArea.getId();
    }

    @Override
    public void update(DiseaseArea diseaseArea) {
        this.diseaseAreaMapper.updateByPrimaryKeySelective(diseaseArea);
    }

    @Override
    public void delete(Long id) {
        this.diseaseAreaMapper.deleteByPrimaryKey(id);
    }

    @Override
    public DiseaseArea queryById(Long id) {
        return this.diseaseAreaMapper.selectByPrimaryKey(id);
    }

    @Override
    public List<DiseaseArea> queryList(DiseaseArea diseaseArea) {
        return this.diseaseAreaMapper.selectByCondition(diseaseArea);
    }
}
